<script language="javascript">
    $(document).ready(function() {
        $('#data_departament').dataTable( {
            "bJQueryUI": true,
            "sPaginationType": "full_numbers",
            "oLanguage": {
                "sLengthMenu": "Mostrar _MENU_ Departamentos por pagina",
                "sZeroRecords": "Ningun departamento encontrado :(",
                "sInfo": "Mostrando _START_ a _END_ de _TOTAL_ Departamentos",
                "sInfoEmpty": "Mostrando 0 a 0 de 0 Departamentos",
                "sInfoFiltered": "(Filtrando de _MAX_ Departamentos)"
            }
        } );
    } );
</script>

<article class="module width_full">
    <header><h3>Lista de Departamentos</h3></header>
    <div class="module_content">
        <article class="breadcrumbs_content">
            <a href="<?php echo $this->url(array('action' => 'add-departament', 'id' => null)) ?>">Agregar Departamento</a>
        </article>

        <table cellpadding="0" cellspacing="0" border="0" class="display" id="data_departament" width="100%">
            <thead>
                <tr>
                    <th>Departamento</th>
                    <th>Descripci&oacute;n</th>
                    <th>Encargado</th>
                    
                    <th>Acciones</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($this->departaments as $departament) : ?> 
                <tr>
                        <td><?php echo $departament['name']; ?></td>
                        <td><?php echo $departament['description']; ?></td>
                        <td><?php echo $departament['name_user']; ?></td>

                        <td class="center">
                            <a href="<?php echo $this->url(array('action' => 'edit-departament', 'id' => $departament['id'])) ?>">
                                <img src="<?php echo $this->baseUrl() ?>/public/styles/admin/images/icn_edit.png"/>
                            </a>
                            <span>&nbsp;&nbsp;&nbsp;</span>
                            <a onclick="return confirm ('Esta seguro que quiere eliminar este Departamento ?')" href="<?php echo $this->url(array('action' => 'delete-departament', 'id' => $departament['id'])) ?>">
                                <img src="<?php echo $this->baseUrl() ?>/public/styles/admin/images/icn_trash.png"/>
                            </a>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</article>